﻿//-------------------------------------------------------------------------------------------------------------------------------------
// Copyright (C) 2005 greatelsoft.com All Rights Reserved
//-------------------------------------------------------------------------------------------------------------------------------------

using System;
using System.Data.Common;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Pub.Class;
using GTS.MiniBox.Entity;

namespace GTS.MiniBox.Helper {
    public partial class OriginSwitchHelper {
        public static bool DeleteByOriginID(int originID, string dbkey) {
            string strSql = new SQL().Delete(OriginSwitch._)
               .Where("1=1").Where(new Where()
                   .And(OriginSwitch._OriginID, originID, Operator.Equal)
               ).ToString();
            int value = dbkey.IsNullEmpty() ? Data.ExecSql(strSql) : Data.Pool(dbkey).ExecSql(strSql);
            if (value != 1) return false;
            return true;
        }
    }
}

